/**
 * Copyright 2012 Fonfon.Xen
 * All rights reserved.
 * 
 * @project 
 * @author Xen
 * @version 1.0
 * @data 2012-5-14
 */
package com.guidecaptain.java.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.guidecaptain.java.mapper.CardMapper;
import com.guidecaptain.java.mapper.LocationMapper;
import com.guidecaptain.java.model.pojo.Card;
import com.guidecaptain.java.model.pojo.Location;
import com.guidecaptain.java.service.LocationService;

/**
 * @author Xen
 * 
 */
@Service("locationService")
public class LocationServiceImpl implements LocationService {

	@Autowired
	private LocationMapper locationMapper;
	@Autowired
	private CardMapper cardMapper;
	/**
	 * @param
	 * @return
	 */
	@Override
	public int insertLocation(Location location) {
		locationMapper.insertLocation(location);
		Card card=new Card();
		card.setCardName("card");
		cardMapper.insertCard(card);
		System.out.println(card.getCardId());
		return location.getLocId();
	}

	/**
	 * @param
	 * @return
	 */
	@Override
	public int deleteLocation(int locId) {

		return locationMapper.deleteLocation(locId);
	}

	/**
	 * @param
	 * @return
	 */
	@Override
	public int updateLocation(Location location) {

		return locationMapper.updateLocation(location);
	}

	/**
	 * @param
	 * @return
	 */
	@Override
	public List<Location> queryLocation(Location Location) {

		return locationMapper.queryLocation();
	}

}
